<?php

namespace App\Services\Code;

use App\Models\Sms;
use App\Notifications\CodeNotification;
use SmsService;
use UserService;
use Carbon\Carbon;


class CodeService
{
    public function send($order)
    {
        $sms = Sms::find(1);
        $template = $sms->template;
        SmsService::mobile($order->mobile, [
            "template" => $template,
            "data" => [
                "name" => $order->mobile,
                "order" => $order->id,
                "time" => Carbon::parse('+3 days')->toDateTimeString()
            ],
        ]);
    }


    protected function code()
    {
        $code = mt_rand(1000, 9999);
        return $code;
    }
}
